Time to GMT
The Time to GMT command returns the difference, in seconds, between the current time and Greenwich mean time (GMT). It is the only command provided by the Time to GMT scripting addition.SYNTAX
time to GMTPARAMETERS
None.RESULT
An integer indicating the difference in seconds between the current time
and GMT.EXAMPLES
Time to GMT returns the difference in seconds between the time of your computer's clock and GMT. For example, if you are in Cupertino, California, and your computer is set to Pacific Standard Time, Time to GMT returns
this result:
time to GMT --result: -28800You can then use this value to write a script that tells you the time difference between the time in any other time zone and the current time in Cupertino:
property offsetFromCupertino : -28800 set x to ((time to GMT) ÷ 60) ÷ 60 set y to x - (((offsetFromCupertino) ÷ 60) ÷ 60) if y = 0 then display dialog ("Same time zone as Cupertino") as string else if y > 0 then display dialog (y & " Hours Ahead of Cupertino") as string else display dialog (-y & " Hours Behind Cupertino") as string end if end ifTo see the effect this script has for different time zones, try setting the time from the Map control panel to various locations, for example, Tokyo, London, and Atlanta.ERRORS